from flask import Flask

from App.ext import init_ext
from App.setting import envs
from App.views import init_view
from apis import init_api  # 使用api 接口

def create_app(env):
    app = Flask(__name__)
    # app.config.from_object(envs.get("development"))
    app.config.from_object(envs.get(env))

    init_ext(app)
    init_view(app=app)
    init_api(app)
    return app
